package com.lagou.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lagou.mapper.ArticleMapper;
import com.lagou.pojo.Article;
import com.lagou.service.ArticleService;

@Service
public class ArticleServiceImpl implements ArticleService {
	
    @Autowired
    private ArticleMapper articleMapper;


	@Override
	public PageInfo<Article> listArticle(int pageNum, int pageSize) {
		PageHelper.startPage(pageNum,pageSize);
        List<Article> articles = articleMapper.selectArticleList();
        PageInfo<Article> articlePage = new PageInfo<>(articles);

        return articlePage;
	}
}
